﻿Imports GdiGaming

Public Class ExampleScene
    Inherits GameScene

    Public Overrides ReadOnly Property Name As String
        Get
            Return "Example"
        End Get
    End Property

    Protected Overrides Sub OnLoad(ByVal e As GdiGaming.GameEngineEventArgs)
        Backgrounds.Add(New SpaceBackground)

        Dim nonColliderCount As Integer = 1000
        Dim colliderCount As Integer = 100
        Dim actualCollisionCount As Integer = 101

        Dim count As Integer = 0
        Dim x As Single = 8
        Dim y As Single = 8
        While count < nonColliderCount
            Objects.Add(New SpinningSquare(count, New Vector2(x, y)))
            x += 14
            If x + 6 > e.Engine.Canvas.DisplayRectangle.Width Then
                y += 14
                x = 8
            End If
            count += 1
        End While

        While count < nonColliderCount + colliderCount
            If count > nonColliderCount + colliderCount - actualCollisionCount Then
                Objects.Add(New Star(count, New Vector2(x - 8, y)))
            Else
                Objects.Add(New Blip(count, New Vector2(x, y)))
            End If
            x += 14
            If x + 6 > e.Engine.Canvas.DisplayRectangle.Width Then
                y += 14
                x = 8
            End If
            count += 1
        End While

        e.Engine.Audio.Play("Hair", True)
        MyBase.OnLoad(e)
    End Sub
End Class
